#!/bin/sh

case "$1" in
"monitor") exit 0 ;;
"failure") exit 1 ;;
"timeout") sleep 99 ;;
"verbose") echo "Running event $1" ; exit 0 ;;
"verbosemultiline")
	cat <<EOF
Running event $1
There are multiple output lines

^^^ including blank lines...

EOF
	exit 0
	;;
"verbosemultilinenonl")
	cat <<EOF
Running event $1
Multiple output lines

EOF
	printf 'No trailing newline'
	exit 0
	;;
"verbosenewlinesonly")
	cat <<EOF



EOF
	exit 0
	;;
"verbosefailure") echo "args: $*"; exit 1 ;;
"verbosemultilinefailure")
	cat <<EOF
Failing event $1
There are multiple output lines

args: $*

EOF
	exit 2
	;;
"verbosetimeout") echo "Sleeping for 99 seconds"; sleep 99 ;;
"verbosetimeout2") echo "Sleeping for 99 seconds"; sleep 99 ;;
*) exit 0 ;;
esac
